﻿using System.Windows;

namespace FanaticRock.AudioManage.Helpers
{
    public static class DurationHelper
    {
        public static TimeSpan ToTimeSpan(Duration duration)
        {
            if (duration == Duration.Automatic) return TimeSpan.Zero;
            if (duration == Duration.Forever) return TimeSpan.Zero;
            if (duration.HasTimeSpan == false) return TimeSpan.Zero;

            return duration.TimeSpan;
        }
    }
}
